package jmu.edu.yjc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jmu.edu.yjc.domain.ResponseResult;
import jmu.edu.yjc.domain.entity.UnAnsweredQuestion;
import jmu.edu.yjc.domain.vo.PageVo;
import jmu.edu.yjc.domain.vo.keyword.UnAnswerQuestionVo;
import jmu.edu.yjc.mapper.UnAnsweredQuestionMapper;
import jmu.edu.yjc.service.UnAnsweredQuestionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 未答问题表(UnAnsweredQuestion)表服务实现类
 *
 * @author makejava
 * @since 2023-03-15 23:30:33
 */
@Service("unAnsweredQuestionService")
public class UnAnsweredQuestionServiceImpl extends ServiceImpl<UnAnsweredQuestionMapper, UnAnsweredQuestion> implements UnAnsweredQuestionService {

    @Override
    public ResponseResult unAnswerList(Integer pageNum, Integer pageSize,String startTime, String endTime, String processStatus) {
        Integer res = (pageNum-1) * pageSize;
        Integer tar = (pageNum) * pageSize;
        List<UnAnswerQuestionVo> vos = baseMapper.unAnswerList(res,tar,startTime,endTime,processStatus);
        Long count = (long) count();
        return ResponseResult.okResult(new PageVo(vos,count));
    }
}
